
function Map() {    
var struct = function(key, value) {    
this.key = key;    
this.value = value;    
};    
	     
var put = function(key, value){    
for(var i = 0; i < this.arr.length; i++) {    
if(this.arr[i].key === key ) {    
this.arr[i].value = value;    
return;    
}    
}    
this.arr[this.arr.length] = new struct(key, value);    
};    
	     
var get = function(key) {    
for (var i = 0; i < this.arr.length; i++) {    
if(this.arr[i].key === key ) {    
return this.arr[i].value;    
}    
}    
return null;    
};
	 
var getByIndex = function(index){
return this.arr[i];
}
	     
var remove = function(key) {    
var v;    
for(var i = 0; i < this.arr.length; i++) {    
v=this.arr.pop();    
if(v.key === key){continue;}    
this.arr.unshift(v);    
}    
};    
	     
var size = function() {    
return this.arr.length;    
};    
	     
var isEmpty = function() {    
return this.arr.length <= 0;    
};    

var clear = function() {
this.arr.length = 0;
};

this.arr = new Array();    
this.get = get;    
this.put = put;    
this.remove = remove;    
this.size = size;    
this.isEmpty = isEmpty;  
this.getByIndex = getByIndex;
}    

function Arguments(){
this.registArg = function(argName, argValue){
return this.map.put(argName, argValue);
};
			
this.getArg = function(argName){
return this.map.get(argName);
};	
			
this.removeArg = function(argName){
return this.map.remove(argName);
};
		
this.getArgsUrl = function(url){
var ar = "";
for(var i=0; i < this.map.size(); i++){
ar = ar + ("&"+this.map.arr[i].key+"="+this.map.arr[i].value);
}	
return url+ar;
};

this.getArgsSize = function(){
return this.map.size();
};

var getByIndex = function(index){
return this.map.arr[i];
};

var clear = function(){
return this.map.clear();
};

this.map = new Map(); 
}